#pragma once
#include "EpilValueObject.h"


class EpilNilObject;
class EpilBooleanObject;
class EpilNumberObject;


class EpilStringObject : public EpilValueObject
{
	EPIL_OBJECT_DECL( String );

public:
	EpilStringObject( EpilInterpreter * interpreter, const tstring & value );
	virtual ~EpilStringObject();

	tstring								GetValue() const								{ return m_value; }

	EpilObject *						OperateUnary( EpilUnaryOperator op );
	EpilObject *						OperateBinary( EpilBinaryOperator op, EpilObject * that );

	bool								operator==( const tstring & rhs ) const;
	bool								operator==( const EpilObject & rhs ) const;
	bool								operator==( const EpilStringObject & rhs ) const;

	virtual EpilValueObject *			Clone() const;
	virtual tstring						ToString() const;

private:
	EpilObject *						OperateBinaryInternal( EpilBinaryOperator op, EpilNilObject * that );
	EpilObject *						OperateBinaryInternal( EpilBinaryOperator op, EpilBooleanObject * that );
	EpilObject *						OperateBinaryInternal( EpilBinaryOperator op, EpilNumberObject * that );
	EpilObject *						OperateBinaryInternal( EpilBinaryOperator op, EpilStringObject * that );

	tstring								m_value;
};
